<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::get('/','Home\IndexController@index');
//前台首页路由分组
Route::group(['prefix'=>'home','namespace'=>'home'],function(){

		//前台路由
		Route::get('index','IndexController@index');
		//前台退出
		Route::get('logout','LoginController@logout');
		//前台登录
		Route::match(['get','post'],'login','LoginController@login');
		//忘记密码
		Route::match(['get','post'],'forget','LoginController@forget');
		//发送验证码
		Route::match(['get','post'],'yanzhengma/{user_name}/user_tel/{user_tel}','LoginController@yanzhengma');
		//修改密码页面
		Route::match(['get','post'],'change','LoginController@change');
		//前台注册
		Route::match(['get','post'],'regist','LoginController@regist');
		//个人中心
		Route::get('member','MemberController@member');
		 //前台上传个人头像
        Route::match(['get','post'],'wen','MemberController@wen');
		//用户收货地址
		Route::get('member_address','MemberController@member_address');
		//用户地址默认选中
		Route::get('is_show/{address_id}','MemberController@is_show');
		//用户地址列表
		Route::get('is_show_list','MemberController@is_show_list');
		//用户地址添加
		Route::match(['get','post'],'is_show_add','MemberController@is_show_add');
		//三级联动
		Route::match(['get','post'],'getcity','MemberController@getcity');
		
		//用户地址修改
		Route::match(['get','post'],'is_show_update/{address_id}','MemberController@is_show_update');
		//用户地址删除
		Route::match(['get','post'],'is_show_delete/{address_id}','MemberController@is_show_delete');
	
		//申请提现
		Route::get('member_cash','MemberController@member_cash');
		//我的收藏
		Route::get('member_collect','MemberController@member_collect');
		//我的收藏删除商品
		Route::get('collect_del/{id}','MemberController@collect_del');
		//收藏点击加入购物车跳的购物车列表
		Route::get('member_buycar/{id}','MemberController@member_buycar');
		//我的佣金
		Route::get('member_commission','MemberController@member_commission');
		//推广链接
		Route::get('member_links','MemberController@member_links');
		//我的会员
		Route::get('member_member','MemberController@member_member');
		//我的会员列表
		Route::get('member_member_list','MemberController@member_member_list');
		//会员余额
		Route::get('member_money','MemberController@member_money');
		//资金管理
		Route::get('member_money_charge','MemberController@member_money_charge');
		//资金管理
		Route::get('member_money_pay','MemberController@member_money_pay');
		//我的留言
		Route::get('member_msg','MemberController@member_msg');
		//我的订单
		Route::get('member_order','MemberController@member_order');
		//我的红包
		Route::get('member_packet','MemberController@member_packet');
		//我的业绩
		Route::get('member_results','MemberController@member_results');
		//账户安全
		Route::get('member_safe','MemberController@member_safe');
		//用户信息
		Route::get('member_user','MemberController@member_user');
		//商品品牌
		Route::get('brand','BrandController@brand');
		//商品品牌列表
		Route::match(['post','get'],'brandlist/{brand_id?}','BrandController@brandlist');
		//品牌商品添加收藏夹
		Route::match(['post','get'],'addcollect/{goods_id}','BrandController@addcollect');
		//热销品牌
		Route::match(['post','get'],'brand_hot/{brand_id?}','BrandController@brand_hot');
		//新品品牌
		Route::match(['post','get'],'brand_new/{brand_id?}','BrandController@brand_new');

		//购物车（第一步）
		Route::get('buycar','MemberController@buycar');
		Route::get('cartdel/{cart_id}','MemberController@cartdel');
		Route::get('checkNumber/{goods_id}/cart_id/{cart_id}/buy_number/{buy_number}/product_attr/{product_attr}','MemberController@checkNumber');
		//跳转到订单页面并将购物车信息入订单
		Route::get('confirm','MemberController@confirm');
		//订单页面收货地址查询
		Route::get('getAddress/{address_id}','MemberController@getAddress');
		//setOrder
		Route::get('setOrder/{address_id}/pay_id/{pay_id}','MemberController@setOrder');
		//确认订单信息（第二步）
		Route::get('buycar_two','MemberController@buycar_two');
		//成功提交订单（第三步）
		Route::get('buycar_three','MemberController@buycar_three');
		//商品分类
		Route::get('category','CateController@category');
		//商品分类列表
		Route::get('categorylist/{cate_id?}','CateController@categorylist');
		// Route::match(['post','get'],'addcollect/{goods_id}','CateController@addcollect');
		Route::get('category_hot','CateController@category_hot');
		Route::get('category_new','CateController@category_new');
		//商品详情（选择参数）
		Route::get('product/{goods_id}','CateController@product');
		//商品详情判断选择参数是否存在（选择参数）
		Route::get('checkAttr/{goods_id}/product_attr/{product_attr}','CateController@checkAttr');
		//商品详情添加到购物车
		Route::get('addCart/{goods_id}/product_attr/{product_attr}/buy_nums/{buy_nums}','CateController@addCart');
		//尚品特卖
		Route::get('sell','CateController@sell');
		//商品详情
		Route::get('selldetails','CateController@selldetails');
		//前台友情链接展示
        Route::match(['get','post'],'friend_links','IndexController@friend_links');

        Route::match(['get','post'],"search/{keyword?}","SearchController@search");

});


//验证码路由
Route::get('/kit/captcha/{tmp}',"KitController@captcha");

//后台路由分组
Route::group(['prefix'=>'admin','namespace'=>'Admin'],function(){

		//后台登录
		Route::match(['post','get'],'login', 'LoginController@login');
		//后台退出登录
		Route::get('login_out', 'LoginController@login_out');
		//后台首页
		Route::get('index', 'IndexController@index');
		//后台首页顶部
		Route::get('top', 'IndexController@top');
		//左侧导航栏
		Route::get('menu', 'IndexController@menu');
		//右侧空白页
		Route::get('main', 'IndexController@main');
		//添加属性
		Route::match(['get','post'],'att_add/{type_id}', 'AttributeController@att_add');
		//属性列表
		Route::get('att_list/{type_id}', 'AttributeController@att_list');
		//属性修改
		Route::match(['get','post'],'att_edit/{type_id}/{attr_id}', 'AttributeController@att_edit');
		//属性删除
		Route::get('att_del/{type_id}/{attr_id}', 'AttributeController@att_del');
		
		//管理员列表
		Route::get('admin_list','AdminController@admin_list');
		//管理员添加
		Route::match(['post','get'],'admin_add','AdminController@admin_add');
		//管理员删除状态
		Route::get('admin_del/{admin_id}','AdminController@admin_del');
		//管理员换原状态
		Route::get('admin_back/{admin_id}','AdminController@admin_back');
		//管理员分配权限
		Route::get('set_node/{admin_id}','AdminController@set_node');
		//管理员添加权限
		Route::any('add_Node','AdminController@add_Node');
		//权限列表
		Route::get('node_list','NodeController@node_list');
		//权限添加
		Route::match(['post','get'],'node_add', 'NodeController@node_add');
		//权限列表
		Route::get('node_list', 'NodeController@node_list');
		//权限修改
		Route::any('node_edit/{node_id}','NodeController@node_edit');
		//获取父级列表
		Route::any('getlist/{level}','NodeController@getlist');
		//权限删除
		Route::get('node_del/{node_id}','NodeController@node_del');
		//权限换原状态
		Route::get('node_back/{node_id}','NodeController@node_back');
		
		//品牌添加
		Route::match(['post','get'],'brand_add', 'BrandController@brand_add');
		//品牌列表
		Route::get('brand_list', 'BrandController@brand_list');
		//品牌修改
		Route::any('brand_edit/{brand_id}','BrandController@brand_edit');
		//品牌删除
		Route::get('brand_del/{brand_id}','BrandController@brand_del');
		//品牌换原状态
		Route::get('brand_back/{brand_id}','BrandController@brand_back');
		//分类添加
		Route::match(['post','get'],'cat_add', 'CatController@cat_add');
		//分类列表删除
		Route::get('cat_del/{id}', 'CatController@cat_del');
		//分类列表
		Route::get('cat_list', 'CatController@cat_list');
		//分类修改
		Route::match(['get','post'],'cat_edit/{id?}', 'CatController@cat_edit');
		//商品添加
		Route::get('goods_add', 'GoodsController@goods_add');
		Route::post('goods_add', 'GoodsController@goods_add');
		//商品加入回收站
		Route::get('goods_del','GoodsController@goods_del');
		//商品列表页的商品属性查询
		Route::get('getAttr/{type_id}','GoodsController@getAttr');
		//商品货号
		Route::get('getGoodsSn','GoodsController@getGoodsSn');
		//商品列表
		Route::get('goods_list', 'GoodsController@goods_list');
		//商品修改
		Route::get('goods_edit', 'GoodsController@goods_edit');
		//货品组合列表
		Route::get('product_list/{goods_id}','ProductController@product_list');
		//添加货品组合
		Route::match(['post','get'],'product_add','ProductController@product_add');
		//商品类型添加
		Route::match(['post','get'],'goods_type_add', 'GoodsController@goods_type_add');
		//商品类型列表
		Route::get('goods_type_list', 'GoodsController@goods_type_list');
		//商品类型修改
		Route::get('goods_type_edit', 'GoodsController@goods_type_edit');
		//轮播图列表
		Route::get('photo_lists','PhotoController@photo_lists');
		//轮播图列表
		Route::match(['get','post'],'photo_add','PhotoController@photo_add');
		//轮播图列表
		Route::match(['get','post'],'photo_up/{id}','PhotoController@photo_up');
		//轮播图列表
		Route::get('photo_del/{id}','PhotoController@photo_del');
		//友情链接列表
		Route::get('links_list','LinksController@links_list');
		//显示友情链接
		Route::get('links_xian/{link_id}','LinksController@links_xian');
		//不显示友情链接
		Route::get('links_buxian/{link_id}','LinksController@links_buxian');
		//添加友情链接
        Route::match(['get','post'],'links_add','LinksController@links_add');
        //修改友情链接
        Route::match(['get','post'],'links_update/{link_id}','LinksController@links_update');
        //商品类型修改
		Route::match(['get','post'],'goods_type_edit/{id?}', 'GoodsController@goods_type_edit');
		//商品类型删除
		Route::get('goods_type_del/{id?}','GoodsController@goods_type_del');
		//推荐位广告列表
		Route::get('Recommend_list','RecommendController@Recommend_list');
		//推荐位广告添加
		Route::match(['get','post'],'Recommend_add','RecommendController@Recommend_add');
		//推荐位广告修改
		Route::match(['get','post'],'Recommend_up/{id}','RecommendController@Recommend_up');
		//推荐位广告删除
		Route::get('Recommend_del/{id}','RecommendController@Recommend_del');
		//推荐位广告推荐
		Route::match(['get','post'],'Recommend_advert/{id}','RecommendController@Recommend_advert');
		//会员列表
		Route::get('member_list','MemberController@member_list');
		//会员修改
		Route::match(['get','post'],'member_up/{id}','MemberController@member_up');
		//会员删除
		Route::get('member_del/{id}','MemberController@member_del');
});
